package org.jradweb.core.beans;

import java.beans.PropertyDescriptor;
/**
 * 
 *
 * Created On 2008-7-8
 * @author <a href="mailto:wagzhi@gmail.com">Paul Wang</a>
 * @version $Id: JBeanWrapper.java 149 2008-10-10 03:10:10Z wagzhi $
 */
public interface JBeanWrapper {
	
	/**
	 * Return the bean instance wrapped by this object, if any.
	 * 
	 * @return the bean instance, or <code>null</code> if none set
	 */
	Object getWrappedInstance();

	/**
	 * Return the type of the wrapped JavaBean object.
	 * 
	 * @return the type of the wrapped bean instance, or <code>null</code> if
	 *         no wrapped object has been set
	 */
	Class getWrappedClass();

	/**
	 * Obtain the PropertyDescriptors for the wrapped object (as determined by
	 * standard JavaBeans introspection).
	 * 
	 * @return the PropertyDescriptors for the wrapped object
	 */
	PropertyDescriptor[] getPropertyDescriptors();

	/**
	 * Obtain the property descriptor for a specific property of the wrapped
	 * object.
	 * 
	 * @param propertyName
	 *            the property to obtain the descriptor for (may be a nested
	 *            path, but no indexed/mapped property)
	 * @return the property descriptor for the specified property
	 * @throws InvalidPropertyException
	 *             if there is no such property
	 */
	PropertyDescriptor getPropertyDescriptor(String propertyName)
			throws InvalidPropertyException;
}
